import {
  TEST,
  SET_STATE_APP,
  SET_WECHAT_OPENID
}
from '../types';

const state = {
  items: [],
  x: 1,
  model: 1,
  tableId: "",
  storeId: "",
  openid: "",
  numberPlate: ""
}

const mutations = {
  [TEST](store, action) {
    state.x += 1;
  }, [SET_STATE_APP](store, data) {
    // debugger
    state.model = (data && data.model) || state.model || 1;
    state.tableId = (data && data.tableId) || state.tableId || "";
    state.storeId = (data && data.storeId) || state.storeId || "";
    state.openid = (data && data.openid) || state.openid || "";
    state.numberPlate = (data && data.numberPlate) || state.numberPlate || "";
  }, [SET_WECHAT_OPENID](store, data) {

    state.openid = data.openid;
  }
}

export default {
  state,
  mutations
}
